// __PUBLIC__/js/page/admin/user/user
require(['../../common'], function() {
  require(['user.userdialog'])
})

define('user.userdialog', [
  'jquery',
  'page/grid'
], function($, Grid) {
  'use strict';

  var $table = $('.table')
  var mygrid = new Grid($table)
  mygrid.init()
  
  
  function loadFrame(url) {
    $(window.parent.document).find('#user-frame').attr('src', url)
  }
  
  $(document)
    .on('click', '.pager a', function(e) {
      loadFrame($(this).data('url'))
    })
    .on('click', '#J_search', function(e) {
      var vuid = $('#dialog_uid').val()
      var vuname = $('#dialog_uname').val()
      var vemail = $('#dialog_email').val()
      var par_get = '&uid=' + vuid + '&uname=' + vuname + '&email=' + vemail
      var url = APP + '?app=admin&m=User&a=userdialog' + par_get
      loadFrame(url)
    })

})
